# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=memdump
pkgver=1.01
pkgrel=7
groups=('blackarch' 'blackarch-forensic')
pkgdesc='Dumps system memory to stdout, skipping over holes in memory maps.'
arch=('x86_64' 'aarch64')
url='http://www.porcupine.org/forensics/tct.html'
license=('custom:IPL')
options=('!makeflags' '!strip')
source=("http://www.porcupine.org/forensics/$pkgname-$pkgver.tar.gz"
        'makedefs.patch')
sha512sums=('46d013f812b0a5807c7ba38d6c3940e105057ba8e64b4f45b75a0800cab212d164caf881efbc1958d5c5c239236fdcb61f6fe093886ff3e28bc0b70791aaee3e'
            '13e905f95ed53e49dd76a29899ae1b03d3c6316b7f1ce71cf09ba5f621281b2523ae6608630b417287ac8a8dce148cea4757653530ebe9051380e9de03899449')

prepare() {
  cd "$pkgname-$pkgver"

  patch -p0 < "../makedefs.patch"
}

build() {
  cd "$pkgname-$pkgver"

  make
}

package() {
  cd "$pkgname-$pkgver"

  # Renamed to fix conflict with community/libmemcached
  install -Dm 755 $pkgname "$pkgdir/usr/bin/memdump-kernel"
  install -Dm 644 "$pkgname.1" "$pkgdir/usr/share/man/man1/$pkgname-kernel.1"
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

